package Oct_2020_BETA.part4;

import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;

public class me {
    public static void main(String[] args) {
        //元素可重复，有null值，有序
        List l=new LinkedList();
        l.add(123);
        l.add("joker");
        l.add(true);
        l.add(2,"ouxigei");
        method(l);
        System.out.println(l.indexOf(true));



    }
    public static void method(List a){
        for (Object o:a){
            System.out.print(o+" ");
        }
        ListIterator li= a.listIterator();
        while (li.hasNext()){
            System.out.println(li.next());
        }
        while (li.hasPrevious()){
            System.out.println(li.previous());
        }
        for (int i=0;i<a.size();i++){
            System.out.println(a.get(i));
        }
    }
}
